import com.guigusuqi.commonutils.utils.JsonUtil;
import com.guigusuqi.payment.entity.RegistrationOrder;
import lombok.extern.log4j.Log4j2;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

@Log4j2
public class tt
{
    @Test

    public void tt()
    {
        String v = "{\"openid\":\"oON5A6chcRFP3fuSUxz7V0eYgYa8\",\"price\":\"0.1\",\"nickname\":\"苏七\",\"registrationId\":\"1\"}";
        RegistrationOrder registrationOrder = new RegistrationOrder();

        Map<String, Object> hashMap = JsonUtil.string2Obj(v, HashMap.class);

        registrationOrder.setOpenid(String.valueOf(hashMap.get("openid")));
        registrationOrder.setNickname(String.valueOf(hashMap.get("nickname")));
        registrationOrder.setPrice(String.valueOf(hashMap.get("price")));

        String openid = String.valueOf(hashMap.get("openid"));
        System.out.println(openid+hashMap.get("price")+hashMap.get("nickname")+hashMap.get("registrationId"));
    }
}
